import Vue from 'vue'

//组件
import Index from '@/page/index/index'
//公告详情
import Notedetail from '@/page/note/notedetail'
//视频查看
import SPCK from '@/page/video/videolist'

//评论
import Comments from '@/page/Comment/Comment'
import Commentlist from '@/page/comment/commentlist'

//内容页展示区域
const root = Vue.component('root', {
  template: '<router-view></router-view>'
});

let routes = [
  {
    path: '/',
    name: 'Index',
    component: Index,
    meta: {
      hidden: true
    }
  }, {
    path: '/',
    component: root,
    meta: {
      requiresAuth: true
    },
    children: [
    {
      //视频查看
       path: 'videolist',
       name: 'SPCK',
       component: SPCK,
    }, {
      //评价
       path: 'comment',
       name: 'Comments',
       component: Comments,
    },{
      //评价列表
      path: 'Commentlist',
      name: 'Commentlist',
      component: Commentlist,
    },{
      //公告
       path: 'notedetail',
       name: 'Notedetail',
       component: Notedetail,
    }
  ]
  }
]


routes[1].children.forEach(route => {
  if (route.children) {
    if (!route.meta) {
      route.meta = {};
    }
    route.meta.children = route.children;
  }
});

export default routes;

